import React from 'react';
import { render } from 'react-dom';
import MediaQuery from 'react-responsive';
import PcIndex from "./adapter/pc/pc_index";
import MobileIndex from "./adapter/mobile/mobile_index";
//路由
import {Router,Route,hashHistory,IndexRoute} from "react-router";
import Baijiahao from "./adapter/pages/baijiahao";
import Guoji from "./adapter/pages/guoji";
import Guonei from "./adapter/pages/guonei";
import Junshi from "./adapter/pages/junshi";
import Shehui from "./adapter/pages/shehui";
import Shouye from "./adapter/pages/shouye";
import Gerenzhongxin from "./adapter/gerenzhongxin/gerenzhongxin";

//
import Hot  from "./adapter/mobile/pages/hot";
import My from "./adapter/mobile/pages/my";
import Fenlei from "./adapter/mobile/pages/fenlei";
import Login from "./adapter/mobile/pages/components/denglu"
import Shezhi from "./adapter/mobile/shezhi/shezhi"



class Hello extends React.Component {
    render() {
        return (
            <div>
                
                <MediaQuery query="(min-device-width: 1224px)">
                        <Router history={hashHistory}>
                            <Route path="/" component={PcIndex}>
                                <IndexRoute  component={Shouye}> </IndexRoute>
                                <Route path="/guoji" component={Guoji}> </Route>
                                <Route path="/guonei" component={Guonei}> </Route>
                                <Route path="/junshi" component={Junshi}> </Route>
                                <Route path="/shehui" component={Shehui}> </Route>
                                <Route path="/baijiahao" component={Baijiahao}> </Route>
                            </Route>
                            <Route path="/gerenzhongxin" component={Gerenzhongxin}> </Route>
                            
                        </Router>
                       
                </MediaQuery>



                
                <MediaQuery query="(max-device-width: 1224px)">
                <div>
                
                    <Router history={hashHistory}>
                        <Route path="/" component={MobileIndex} >
                            <IndexRoute component={Hot}></IndexRoute>
                            <Route path="/fenlei" component={Fenlei}></Route>
                            <Route path="/my" component={My}></Route>
                            <Route path="/mobiledenglu" component={Login}></Route>
                        </Route>
                        <Route path="/shezhi" component={Shezhi}></Route>
                        <Route path='*' component={MobileIndex}>
                            <IndexRoute component={Hot}></IndexRoute>
                        </Route>
                        
                        
                    </Router> 
                </div>
                </MediaQuery>
            </div>
        )
    }
}

render(
    <Hello/>,
    document.getElementById('root')
)
